package entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "Users")
public class User {
	@Id
	@Column(name = "user_id")
	private int id;
	@Column(nullable = false, unique = true)
	private String username;
	@Column(nullable = false)
	private String password;
	private String fname;
	private String lname;
	@Column(nullable = false)
	private String email;
	@Column(nullable = false)
	private String role;
	
	public User(){
		
	}
	
	public String getFname() {
		return fname;
	}
	public void setFname(String fname) {
		this.fname = fname;
	}
	public String getLname() {
		return lname;
	}
	public void setLname(String lname) {
		this.lname = lname;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}	
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}	
	public String getRole(){
		return this.role;
	}
	public void setRole(String role){
		this.role = role;
	}
	
	@Override
	public String toString() {
		String s = "Username: " + username + "\n";
		s += "First Name: " + fname + "\n";
		s += "Last Name: " + lname + "\n";
		s += "Email: " + email + "\n";
		return s;
	}
}
